package com.pickgliss.loaders
{
	import com.pickgliss.ds.BitmapLib;
	import com.pickgliss.events.LoaderEvent;
	import com.pickgliss.utils.StringUtils;
	
	import flash.display.Bitmap;
	import flash.display.Loader;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IEventDispatcher;
	import flash.net.URLRequest;
	import flash.utils.ByteArray;

	public class BitmapLoader extends DisplayLoader
	{
		protected var _catchable:Boolean;
		public function BitmapLoader(url:String, callback:Function = null, catchable:Boolean=true)
		{
			_catchable=catchable;
			super(url,callback);
		}
		
		override protected function __onContentLoadComplete(event:Event):void
		{
			super.__onContentLoadComplete(event);
			BitmapLib.Instance.addItem(StringUtils.removeUrlParameter(_url),this);
		}
		
		override public function get content():*
		{
			return _displayLoader.content;
		}
		
		override public function get type():int
		{
			return LoaderTypes.BITMAP_LOADER;
		}
	}
}
